#include <stdlib.h>
#include <iostream>
#include <verilated.h>
#include <verilated_vcd_c.h>
#include "Valu__Syms.h"

#define MAX_SIM_TIME 20
vluint64_t sim_time = 0;
uint64_t rand_uint64_slow(void) {
  uint64_t r = 0;
  for (int i=0; i<64; i++) {
    r = r*2 + rand()%2;
  }
  return r;
}

int main(int argc, char** argv, char** env) {
    Valu *dut = new Valu;
    uint64_t a, b = 1;
    while (sim_time < MAX_SIM_TIME) {
        a=rand_uint64_slow();
        b=rand_uint64_slow();
        dut->busA=a;
        dut->busB=b;
        dut->ALUop=0;
        dut->eval();
        printf("a=%ld b =%ld a+b=%ld o=%ld\n", a, b, a+b ,dut->ALUout);
        sim_time++;
    }
    delete dut;
    exit(EXIT_SUCCESS);
}